namespace Glpt.Office
{
    /// <summary>
    /// Excel基本类
    /// </summary>
    public class ExcelInfo
    {
        private static string DefaultExtension = "";
        /// <summary>
        /// 获取Excel默认扩展名
        /// </summary>
        /// <returns>扩展名</returns>
        public static string GetDefaultExtension()
        {
            if (DefaultExtension.Length == 0)
            {
                DefaultExtension = "xls";
                string _excelPath = OfficeVersion.GetComponentPath(OfficeComponent.Excel);
                int _ver = OfficeVersion.GetMajorVersion(_excelPath);
                if (_ver >= 12)
                    DefaultExtension = "xlsx";
            }
            return DefaultExtension;
        }
    }
}
